layerscape: fix integer handling issues
authorJiafei Pan <[email protected]>
Wed, 11 Apr 2018 12:12:24 +0000 (12:12 +0000)
committerJiafei Pan <[email protected]>
Wed, 11 Apr 2018 12:12:24 +0000 (12:12 +0000)
Assert before actually using.

Signed-off-by: Jiafei Pan <[email protected]>
plat/layerscape/board/ls1043/ls1043_psci.c

index a41e79e548b01996875c14bac06d16d4f7c9a968..1c83df437a8b70a74427df1b1075acd9fedb9434 100644 (file)
@@ -94,10 +94,10 @@ static void __dead2 ls1043_system_reset(void)
 static int ls1043_pwr_domain_on(u_register_t mpidr)
 {
        int core_pos = plat_core_pos_by_mpidr(mpidr);
-       uint32_t core_mask = 1 << core_pos;
-       uint32_t brr;
+       uint32_t core_mask, brr;
 
        assert(core_pos >= 0 && core_pos < PLATFORM_CORE_COUNT);
+       core_mask = 1 << core_pos;
 
        /* set warm boot entry */
        mmio_write_32(LS_SCFG_BASE + LS_SCFG_SCRATCHRW0_OFFSET,